var pageii = null;
var grid = null;
$(function() {
	grid = lyGrid({
		pagId : 'paging',
		l_column : [{
			colkey : "material_code",
			name : "编码"
		}, {
			colkey : "oname",
			name : "名称"
		}, {
			colkey : "unit",
			name : "单位"
		}, {
			colkey : "mold_code",
			name : "模具"
		}, {
			colkey : "cname",
			name : "客户"
		}, {
			colkey : "remark",
			name : "备注"
		}, {
			colkey : "production_weight",
			name : "重量"
		}, {
			colkey : "orderPack",
			name : "每袋件数"
		}, {
			colkey : "setCount",
			name : "配套数量"
		}, {
			colkey : "price",
			name : "销售单价"
		}, {
			colkey : "plannedCost",
			name : "计划成本"
		} ],
		jsonUrl : rootPath
				+ '/labelmaterial_form/labelmaterial_form_findByPage.shtml',
		dymCol : true,
		checkbox : true,
		serNumber : false
	});
	$("#editFun").click("click", function() {
		editAccount();
	});
	$("#search").click("click", function() {//  绑定查询按扭
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});

});
function editAccount() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		 layer.msg("只能选中一个");
		 return;
	}
	pageii = layer.open({
		title : "编辑物料信息表",
		type : 2,
		area : [ "800px", "100%" ],
		content : rootPath
				+ '/labelmaterial_form/labelmaterial_form_edit.shtml?id=' + cbox
	});
}







